
/**
 * Implements the logical OR operation over two or more packet filters. In
 * other words, packets pass this filter if they pass <b>any</b> of the filters.
 *
 * @author Matt Tucker
 */
class OrFilter : public PacketFilter {
public:
    /**
     * Creates an empty OR filter. Filters should be added using the
     * {@link #addFilter(PacketFilter)} method.
     */
    OrFilter() {};
	
    /**
     * Creates an OR filter using the two specified filters.
     *
     * @param filter1 the first packet filter.
     * @param filter2 the second packet filter.
     */
    OrFilter(PacketFilter * filter1, PacketFilter * filter2);
	
    /**
     * Adds a filter to the filter list for the OR operation. A packet
     * will pass the filter if any filter in the list accepts it.
     *
     * @param filter a filter to add to the filter list.
     */
    void addFilter(PacketFilter * filter);

	bool accept(Packet * packet);

private:
    /**
     * The list of filters.
     */
	std::vector<PacketFilter*>  filters;
};
